package com.cheng.service;

import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;

import org.springframework.stereotype.Service;

import com.cheng.bos.foreUtils.MailUtils;

@Service("emaileService")
public class EmaileService implements MessageListener{

	@Override
	public void onMessage(Message message) {
		try {
			MapMessage mapMessage = (MapMessage) message;
			String address = mapMessage.getString("address");
			String content = mapMessage.getString("content");
			MailUtils.sendMail("速运快递邮箱激活邮件", content, address);
System.out.println("邮件已发送!"+address);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
